<template>
  <div class="list">
    <post-search
      @query-click="handleQueryClick"
      @reset-click="handleResetClick"
    />
    <post-content ref="contentRef" />
  </div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import PostSearch from './c-cpns/post-search.vue'
import PostContent from './c-cpns/post-content.vue'

const contentRef = ref<InstanceType<typeof PostContent>>()
function handleQueryClick(formData: any) {
  contentRef.value?.fetchPostListData(formData)
}
function handleResetClick() {
  contentRef.value?.fetchPostListData()
}
</script>

<style scoped lang="less">
.list {
  border-radius: 8px;
  overflow: hidden;
}
</style>
